import { Button, Form, message, Select } from 'antd'
import ddImage from '../../image/dd.png'
import wxImage from '../../image/wx.png'
import { OauthType } from '../../types'
import './index.less'

export default function Oauth2LoginComponent(props: { onClick: (val: string) => void }) {
  const handleDDLogin = (key: string) => {
    if (key !== OauthType.DD) {
      message.warning('当前仅支持钉钉扫码登录～')
      return
    }
    props.onClick(key)
  }
  const items = [
    {
      key: OauthType.DD,
      img: ddImage,
      onClick: handleDDLogin,
    },
    // {
    //   key: OauthType.WX,
    //   img: wxImage,
    //   onClick: handleDDLogin,
    // },
  ]
  return (
    <div className="oauth2_login_page">
      {items?.map((item) => {
        return <img className="olp_icon" key={item.key} src={item.img} onClick={() => item.onClick(item.key)} alt="" />
      })}
    </div>
  )
}
